/* 
 * File:   SimulationBuffer.h
 * Author: cjjonker
 *
 * Created on 23 januari 2013, 17:24
 */

#ifndef SIMULATIONBUFFER_H
#define	SIMULATIONBUFFER_H

#include "rfftw.h"

class SimulationBuffer {
    
    static const int maxbufferlength = 40;
    
    int d_bufferlength;
    int d_currentindex;
    
    fftw_real vx [maxbufferlength];
    fftw_real vy [maxbufferlength];             //(vx,vy)   = velocity field at the current moment
    fftw_real fx [maxbufferlength]; 
    fftw_real fy [maxbufferlength];	            //(fx,fy)   = user-controlled simulation forces, steered with the mouse
    fftw_real rho [maxbufferlength];
    
    
   
    
public:
    SimulationBuffer();
    virtual ~SimulationBuffer();
    
    int bufferlength();
    void bufferlength(int l);
    
    void clearBuffer();
    
    void updateBuffer( fftw_real vx, fftw_real vy, fftw_real fx, fftw_real fy, fftw_real rho);
    
private:

};

inline void SimulationBuffer::bufferlength(int l) { d_bufferlength = l; }

inline int SimulationBuffer::bufferlength() { return d_bufferlength; }

#endif	/* SIMULATIONBUFFER_H */

